package edu.westga.cs3152.wordmojo;

import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;


public class GUIObserver implements ActionListener{
	private Controller gameController;
	
	public GUIObserver(Controller gameController) {
		this.gameController = gameController;
	}

	public void actionPerformed(ActionEvent e) {
		Object source = e.getSource();
		if(((Component) source).getName() == "submit"){
			gameController.evaluateBoardSubmission();
		}
		else if(((Component) source).getName() == "help"){
			gameController.showHints();
		}
		else if (source instanceof Letter){
			gameController.selectOrDropTile(source);	
		}
	}
}
